package ru.papergames.battleserver.network.serverpackets.flashuser;

import ru.papergames.battleserver.model.battle.AbstractBattle;

/**
 * @author atroshanin
 */
public class BattleMapInfo extends PaperGameServerPacket {

    private final AbstractBattle battle;

    public BattleMapInfo(AbstractBattle battle) {
        this.battle = battle;
    }

    @Override
    protected int getPacketId() {
        return BATTLE_MAP_INFO_PACKET_ID;
    }

    @Override
    protected void writePacketData() {
        writeD(battle.getBattleOrderId());
        writeH(battle.getBattleMap().getWidth());
        writeH(battle.getBattleMap().getHeight());

        // todo: send also obstacles
        // List<Obstacle> obstacles = battle.getBattleMap().getObstacles();
    }

    public AbstractBattle getBattle() {
        return battle;
    }
}
